﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.LineUtility
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine
{
  /// <summary>
  ///   <para>A collection of common line functions.</para>
  /// </summary>
  [NativeHeader("Runtime/Export/Graphics/LineUtility.bindings.h")]
  public sealed class LineUtility
  {
    public static void Simplify(List<Vector3> points, float tolerance, List<int> pointsToKeep)
    {
      if (points == null)
        throw new ArgumentNullException(nameof (points));
      if (pointsToKeep == null)
        throw new ArgumentNullException(nameof (pointsToKeep));
      LineUtility.GeneratePointsToKeep3D((object) points, tolerance, (object) pointsToKeep);
    }

    public static void Simplify(
      List<Vector3> points,
      float tolerance,
      List<Vector3> simplifiedPoints)
    {
      if (points == null)
        throw new ArgumentNullException(nameof (points));
      if (simplifiedPoints == null)
        throw new ArgumentNullException(nameof (simplifiedPoints));
      LineUtility.GenerateSimplifiedPoints3D((object) points, tolerance, (object) simplifiedPoints);
    }

    public static void Simplify(List<Vector2> points, float tolerance, List<int> pointsToKeep)
    {
      if (points == null)
        throw new ArgumentNullException(nameof (points));
      if (pointsToKeep == null)
        throw new ArgumentNullException(nameof (pointsToKeep));
      LineUtility.GeneratePointsToKeep2D((object) points, tolerance, (object) pointsToKeep);
    }

    public static void Simplify(
      List<Vector2> points,
      float tolerance,
      List<Vector2> simplifiedPoints)
    {
      if (points == null)
        throw new ArgumentNullException(nameof (points));
      if (simplifiedPoints == null)
        throw new ArgumentNullException(nameof (simplifiedPoints));
      LineUtility.GenerateSimplifiedPoints2D((object) points, tolerance, (object) simplifiedPoints);
    }

    [FreeFunction("LineUtility_Bindings::GeneratePointsToKeep3D", IsThreadSafe = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void GeneratePointsToKeep3D(
      object pointsList,
      float tolerance,
      object pointsToKeepList);

    [FreeFunction("LineUtility_Bindings::GeneratePointsToKeep2D", IsThreadSafe = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void GeneratePointsToKeep2D(
      object pointsList,
      float tolerance,
      object pointsToKeepList);

    [FreeFunction("LineUtility_Bindings::GenerateSimplifiedPoints3D", IsThreadSafe = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void GenerateSimplifiedPoints3D(
      object pointsList,
      float tolerance,
      object simplifiedPoints);

    [FreeFunction("LineUtility_Bindings::GenerateSimplifiedPoints2D", IsThreadSafe = true)]
    [MethodImpl(MethodImplOptions.InternalCall)]
    internal static extern void GenerateSimplifiedPoints2D(
      object pointsList,
      float tolerance,
      object simplifiedPoints);
  }
}
